package com.smomo.blog.Text;


import cn.dev33.satoken.stp.StpUtil;
import com.smomo.blog.exception.BusinessException;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/v1")
public class Demo1 {

    @GetMapping("/aa")
    public int aa()
    {
//        int i=10/0;
//       StpUtil.checkLogin();
       throw new BusinessException("测试8888888888");
//        return 0;
    }
    @GetMapping("methodOne")
    public Object methodOne(Model model){
        Map<Integer,String> info = (Map<Integer, String>) model.getAttribute("info");
        return info;
    }

}
